package java7;

import java.util.Scanner;

public class Code087 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("请输入录入学生姓名: ");
		String name = input.next();
		double sum = 0;
		double j=0;
		for(int i=1;i<=5;i++){
			System.out.print("请录入第"+i+"门课的成绩\t");
			while(!input.hasNextDouble()){
				System.out.println("录入的成绩类型不对，请重新录入！");
				input.next();
			}
			double num = input.nextDouble();
			while(num<0){
				System.out.println("成绩不能为负数，请重新输入！");
				int snum = input.nextInt();
				num=snum;
			}
			sum+=num;
			if(num>=80){
				j++;
			}
		}
		System.out.println(name+"同学的五门课的成绩总和为"+sum);
		System.out.println(name+"同学的五门课的平均成绩为"+(sum/5.0));
		System.out.print("优秀率为"+((j/5.0)*100)+"%");
	}
}
